<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/4/15
  Time: 16:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<script type="text/javascript">
   function json(){
       //json 对象
        var obj ={
            name:"lisi",
            "age":12,
            like:["",""]
        }
        alert(obj.name)

        //json 数组
        var num=[1,2,3]
        alert(num[0])

        var num1=[{name:"lisi",age:12},{name:"wangwu",age:13},{}]
        for (var i=0;i<num1.length;i++){
             console.log(num1[i].name)
        }

    }






</script>

<body>

<button onclick="json()"></button>

</body>
</html>
